package com.audaque.springboot.foshanupload.web.redisdemo.controller;

/**
 * @author zgb
 * @desc ...
 * @date 2021-12-26 19:41:32
 */


import com.audaque.springboot.foshanupload.redis.service.RedisIncrRateLimiterAnnoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("redisIncrRateLimiterAnno")
public class RedisLuaIncrRateLimiterAnnoController {
    @Autowired
    RedisIncrRateLimiterAnnoService redisIncrRateLimiterAnnoService;


    //分布式
    @GetMapping("/add")
    public List<Boolean> add() throws Exception {
        List<Boolean> result = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            Boolean aBoolean = redisIncrRateLimiterAnnoService.addResult();
            result.add(aBoolean);
        }
        return result;
    }


}
